home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Tools & Apps / Misc. Utilities / Installer 3.4 / Examples - Installer 3.4 / AddAuditTrail.r next >
Encoding:
Text File  |  1992-09-21  |  4.8 KB  |  133 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: adding an audit trail
  6.  *
  7.  *    File:        AddAuditTrail.r -    Rez Source
  8.  *
  9.  *    by:        Jon Zap
  10.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  11.  *
  12.  *    Copyright © 1991 Apple Computer, Inc.
  13.  *    All rights reserved.
  14.  *
  15.  *------------------------------------------------------------------------------
  16.  *
  17.  * Install "TeachText" into the folder "Root":Installed Application and then
  18.  * add an audit record to the system file.  
  19.  *----------------------------------------------------------------------------*/
  20.  
  21. #include "InstallerTypes.r"
  22.  
  23. /* You can build and complete the script with the following lines:
  24. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  25. # or set up folders with the same names and contents as the floppies
  26. # put these folders in the same folder as the script or at the root directory of same disk
  27. # For demonstration purposes, the application TeachText is used as the sample
  28. # application on a disk named "Program Disk".  The script will install TeachText
  29. # into the folder "Installed Application:" at the root of the target disk.
  30.  
  31.     rez -o "AddAuditTrail" -t 'bbkr' -c 'bbkr' "AddAuditTrail.r"
  32.     setfile -a i "AddAuditTrail"        #mark Inited
  33.     scriptcheck -p "AddAuditTrail"
  34. */
  35.  
  36. /* put a 1 in the creation date field of source 'infs' to have ScriptCheck set date */
  37. #define kScriptCheckSetsDate    0x01
  38.  
  39. /* Defines for the file spec atoms (specifications for source and destination files) */
  40. #define fsSourceProgram            2000
  41. #define fsTargetProgram            2001
  42. #define fsTargetSystem            2002
  43.  
  44. /* This is the name of the source disk */
  45. #define ProgramDisk "Program Disk:"
  46.  
  47. /* This is the target path for where we want to install the file. */
  48. #define TargetPath    ":Installed Application:"
  49.  
  50. /* Definition for the package. */
  51. #define pkTheProgram            3000
  52.  
  53. /* Definition for the file atom */
  54. #define faProgram                4000
  55.  
  56. /* Definition for the audit atom */
  57. #define atProgram                5000
  58. #define auditProgram            'MOOF'
  59. #define auditProgVer            2
  60.  
  61. /***************************** Package Resources ************************************************/
  62. resource 'inpk' (pkTheProgram) {
  63.     format0 {
  64.         showsOnCustom,             /* Package appears in the Custom Install display */
  65.         removable,                /* Package can be removed */
  66.         dontForceRestart,        /* adding an audit atom to system file doesn't require reboot */
  67.         0,                         /* 'icmt' not required */
  68.         0,                        /* Package size (filled in by ScriptCheck) */
  69.         "The Program audit", {        /* package name */
  70.             'infa', faProgram;
  71.             'inat', atProgram;
  72.         }
  73.     }
  74. };
  75.  
  76. /********************************************* File Specs ***************************************/
  77. /* Source File Specs */
  78. resource 'infs' (fsSourceProgram) {
  79.     'APPL',                                /* File Type for TeachText */
  80.     'ttxt',                                /* Creator for TeachText for 7.0 */
  81.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  82.     noSearchForFile,                    /* Do not search the source disk for the file */
  83.     typeCrMustMatch,                    /* file type and creator on this file must match */
  84.     ProgramDisk"TeachText"                /* Path to the file */
  85. };
  86.  
  87. /* Target File Specs */
  88. resource 'infs' (fsTargetProgram) {
  89.     'APPL',                                /* File Type for TeachText */
  90.     'ttxt',                                /* Creator for TeachText for 7.0 */
  91.     0,                                    /* not needed for target file spec */
  92.     noSearchForFile,                    /* Do not search the target disk for the file */
  93.     typeCrMustMatch,                    /* not needed for target file specs */
  94.     TargetPath"TeachText"                /* installation Path */
  95. };
  96.  
  97. resource 'infs' (fsTargetSystem) {
  98.     'ZSYS',                                /* File Type */
  99.     'MACS',                                /* Creator */
  100.     0,                                    /* not needed for target file spec */
  101.     noSearchForFile,                    /* Do not search the target disk for the file */
  102.     typeCrNeedNotMatch,                    /* not needed for target file specs */
  103.     "special-macs:System"                /* installation Path */
  104. };
  105.  
  106. /***************************************** File Atoms ************************************************/
  107. resource 'infa' (faProgram) {
  108.     format0 {
  109.         deleteWhenRemoving,                /* Delete the file if remove (option-custom) is clicked    */
  110.         dontDeleteWhenInstalling,         /* don't need to predelete the target before copying new one */
  111.         copy,                             /* Copy the file to the destination */
  112.         leaveAloneIfNewer,                 /* do not Install this version, if newer one exists */
  113.         updateExisting,                 /* replace an existing copy, if mine is newer */
  114.         noUpdateOnly,                    /* Copy whether the target file exists or not */
  115.         rsrcFork, dataFork,                /* Copy both forks of the file */
  116.         fsTargetProgram,                /* TARGET file spec */
  117.         fsSourceProgram,                 /* SOURCE file spec */
  118.         0,                                /* atom size (filled in by ScriptCheck) */
  119.         ""                                /* Atom Description (for a file Installer will use file name) */
  120.     };
  121. };
  122.  
  123. resource 'inat' (atProgram) {
  124.     format0 {
  125.         fsTargetSystem,
  126.         auditProgram,
  127.         auditProgVer
  128.     };
  129. };
  130.  
  131.  
  132.  
  133.